package com.linshengjian.power.service;

import com.linshengjian.core.BusinessException;
import com.linshengjian.core.IBaseService;
import com.linshengjian.power.model.Permission;
import com.linshengjian.power.model.Resources;

import java.util.List;

public interface IPermissionService extends IBaseService<Permission, Integer> {
    /**
     * 添加资源到权限中
     * @param pid 权限ID
     * @param rid 资源ID
     */
    void addResources(Integer pid, Integer rid) throws BusinessException;

    /**
     * 从权限中删除指定资源
     * @param pid 权限ID
     * @param rid 资源ID
     */
    void delResources(Integer pid, Integer rid) throws BusinessException;

    /**
     * 获取权限下的所有资源
     * @param id 权限ID
     * @return
     */
    List<Resources> resources(Integer id) throws BusinessException;
}
